#ifndef BATTERYWIDGET_H
#define BATTERYWIDGET_H

#include <QWidget>
#include <QPainter>
#include <QPaintEvent>
#include <QColor>

class BatteryWidget : public QWidget
{
    Q_OBJECT

public:
    BatteryWidget(QWidget *parent = nullptr);
    // 设置电池电量百分比
    void setBatteryLevel(int level);
protected:
    void paintEvent(QPaintEvent *event) override;
private:
    int batteryLevel; // 电池电量百分比
};

#endif //BATTERYWIDGET_H
